<?php
/**
 * $_POST,$_GETから受け取ったデータがちゃんとUTF-8であるかのチェック用
 *
 */
if(!function_exists('checkEncoding')){
    function checkEncoding ( $string, $string_encoding ){
        $fs = $string_encoding == 'UTF-8' ? 'UTF-32' : $string_encoding;
        $ts = $string_encoding == 'UTF-32' ? 'UTF-8' : $string_encoding;
        return $string === mb_convert_encoding ( mb_convert_encoding ( $string, $fs, $ts ), $ts, $fs );
    }
}
?>